--
-- PostgreSQL database dump
--

-- Started on 2009-11-13 14:12:27

SET client_encoding = 'SQL_ASCII';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 1747 (class 0 OID 0)
-- Dependencies: 4
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON SCHEMA public IS 'Standard public schema';


--
-- TOC entry 296 (class 2612 OID 16386)
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE PROCEDURAL LANGUAGE plpgsql;


SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 1301 (class 1259 OID 16998)
-- Dependencies: 4
-- Name: contactos_huesped; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE contactos_huesped (
    cntcod character varying(4) NOT NULL,
    cntdesc character varying(40)
);


ALTER TABLE public.contactos_huesped OWNER TO postgres;

--
-- TOC entry 1303 (class 1259 OID 17004)
-- Dependencies: 4
-- Name: estadocivil; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE estadocivil (
    ecvcod integer NOT NULL,
    ecvdesc character varying(20),
    ecvabr character varying(3)
);


ALTER TABLE public.estadocivil OWNER TO postgres;

--
-- TOC entry 1749 (class 0 OID 0)
-- Dependencies: 1303
-- Name: TABLE estadocivil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE estadocivil IS 'DESCRIPCION: Tabla de Estado Civil de las Personas

PRIMARY KEY =  (ECvCod)
FOREING KEY =


Tabla de Estados Civiles de las personas';


--
-- TOC entry 1750 (class 0 OID 0)
-- Dependencies: 1303
-- Name: COLUMN estadocivil.ecvcod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadocivil.ecvcod IS 'ECvCod = Codigo de Estado Civil

PRIMARY KEY = (ECvCod)

Atributo de Tipo SERIAL
';


--
-- TOC entry 1751 (class 0 OID 0)
-- Dependencies: 1303
-- Name: COLUMN estadocivil.ecvdesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadocivil.ecvdesc IS 'ECvDesc = Descripcion del Estado Civil

Valores: "Soltero", "Viudo", etc';


--
-- TOC entry 1752 (class 0 OID 0)
-- Dependencies: 1303
-- Name: COLUMN estadocivil.ecvabr; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadocivil.ecvabr IS 'ECvAbr = Abreviacion del Estado Civil

Valores:  SOL = Soltero
               VIU = Viudo
               DIV = Divorciado';


--
-- TOC entry 1302 (class 1259 OID 17002)
-- Dependencies: 4 1303
-- Name: estadocivil_ecvcod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE estadocivil_ecvcod_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.estadocivil_ecvcod_seq OWNER TO postgres;

--
-- TOC entry 1753 (class 0 OID 0)
-- Dependencies: 1302
-- Name: estadocivil_ecvcod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE estadocivil_ecvcod_seq OWNED BY estadocivil.ecvcod;


--
-- TOC entry 1754 (class 0 OID 0)
-- Dependencies: 1302
-- Name: estadocivil_ecvcod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('estadocivil_ecvcod_seq', 2, true);


--
-- TOC entry 1305 (class 1259 OID 17011)
-- Dependencies: 4
-- Name: estadohabitacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE estadohabitacion (
    ehacod integer NOT NULL,
    ehadesc character varying(20),
    ehaabr character varying(3),
    ehacol character varying(10),
    ehaact boolean
);


ALTER TABLE public.estadohabitacion OWNER TO postgres;

--
-- TOC entry 1755 (class 0 OID 0)
-- Dependencies: 1305
-- Name: TABLE estadohabitacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE estadohabitacion IS 'DESCRIPCION: Tabla de Estado de la Habitacion

PRIMARY KEY =  (EHaCod)
FOREING KEY =



';


--
-- TOC entry 1756 (class 0 OID 0)
-- Dependencies: 1305
-- Name: COLUMN estadohabitacion.ehacod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadohabitacion.ehacod IS 'EHaCod = Codigo de Estado de Habitacion

PRIMARY KEY = (EHaCod)';


--
-- TOC entry 1757 (class 0 OID 0)
-- Dependencies: 1305
-- Name: COLUMN estadohabitacion.ehadesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadohabitacion.ehadesc IS 'EHaDesc = Descripcion del Estado de la Habitacion.

Valores:  "RESERVADO"
               "RESERVA CONFIRMADO"
               "VACIO"
               "DISPONIBLE"
               "BLOQUEADO"
               "RESERVA EN LISTA"';


--
-- TOC entry 1758 (class 0 OID 0)
-- Dependencies: 1305
-- Name: COLUMN estadohabitacion.ehaabr; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadohabitacion.ehaabr IS 'EHaAbr= Abreviacion del Estado de la Habitacion

Valores:  "RESERVADO"                     =  "RSV"
               "RESERVA CONFIRMADO"  = "RSC"
               "VACIO"                                 =  "VAC"
               "DISPONIBLE"                      =  "DSP"
               "BLOQUEADO"                     =  "BLQ"
               "RESERVA EN LISTA"         =  "RSL"  ';


--
-- TOC entry 1759 (class 0 OID 0)
-- Dependencies: 1305
-- Name: COLUMN estadohabitacion.ehacol; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadohabitacion.ehacol IS 'EHaCol = Codigo de Color RGB, para pintar en el PLANNING

RGB:  "BLANCO"
           "AZUL"
           "AMARILLO"';


--
-- TOC entry 1760 (class 0 OID 0)
-- Dependencies: 1305
-- Name: COLUMN estadohabitacion.ehaact; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN estadohabitacion.ehaact IS 'EHaAct = Estado de Activacion de la Habitacion

Valores:  .True.   (1)  = Activado
              .False.  (0)   = Deactivado';


--
-- TOC entry 1304 (class 1259 OID 17009)
-- Dependencies: 4 1305
-- Name: estadohabitacion_ehacod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE estadohabitacion_ehacod_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.estadohabitacion_ehacod_seq OWNER TO postgres;

--
-- TOC entry 1761 (class 0 OID 0)
-- Dependencies: 1304
-- Name: estadohabitacion_ehacod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE estadohabitacion_ehacod_seq OWNED BY estadohabitacion.ehacod;


--
-- TOC entry 1762 (class 0 OID 0)
-- Dependencies: 1304
-- Name: estadohabitacion_ehacod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('estadohabitacion_ehacod_seq', 2, true);


--
-- TOC entry 1307 (class 1259 OID 17018)
-- Dependencies: 4
-- Name: formapago; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE formapago (
    fpgcod integer NOT NULL,
    fpgdesc character varying(20),
    fpgabr character varying(3)
);


ALTER TABLE public.formapago OWNER TO postgres;

--
-- TOC entry 1763 (class 0 OID 0)
-- Dependencies: 1307
-- Name: TABLE formapago; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE formapago IS 'DESCRIPCION: Tabla de Forma de Pago
                          Tabla para indicar las formas de pago aceptadas por el hotel

PRIMARY KEY =  (FPgCod)
FOREING KEY =


';


--
-- TOC entry 1764 (class 0 OID 0)
-- Dependencies: 1307
-- Name: COLUMN formapago.fpgcod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN formapago.fpgcod IS 'FPgCod = Codigo de Forma de Pago

PRIMARY KEY = (FPgCod)';


--
-- TOC entry 1765 (class 0 OID 0)
-- Dependencies: 1307
-- Name: COLUMN formapago.fpgdesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN formapago.fpgdesc IS 'FPgDesc = Descripcion de la Forma de Pago

Valores:  "EFECTIVO"
               "CHEQUE"
               "TARJETA DE CREDITO"';


--
-- TOC entry 1766 (class 0 OID 0)
-- Dependencies: 1307
-- Name: COLUMN formapago.fpgabr; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN formapago.fpgabr IS 'FPgAbr = Abreviacion de la Forma de Pago

Valores:  "EFECTIVO"                        = "EFE"
               "CHEQUE"                          = "CHQ"
               "TARJETA DE CREDITO"  = "TCR"';


--
-- TOC entry 1306 (class 1259 OID 17016)
-- Dependencies: 4 1307
-- Name: formapago_fpgcod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE formapago_fpgcod_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.formapago_fpgcod_seq OWNER TO postgres;

--
-- TOC entry 1767 (class 0 OID 0)
-- Dependencies: 1306
-- Name: formapago_fpgcod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE formapago_fpgcod_seq OWNED BY formapago.fpgcod;


--
-- TOC entry 1768 (class 0 OID 0)
-- Dependencies: 1306
-- Name: formapago_fpgcod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('formapago_fpgcod_seq', 1, false);


--
-- TOC entry 1309 (class 1259 OID 17025)
-- Dependencies: 4
-- Name: habitacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE habitacion (
    habcod integer NOT NULL,
    habdesc character varying(20),
    ehacod bigint
);


ALTER TABLE public.habitacion OWNER TO postgres;

--
-- TOC entry 1769 (class 0 OID 0)
-- Dependencies: 1309
-- Name: TABLE habitacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE habitacion IS 'DESCRIPCION: Tabla de Habitaciones del HOTEL

PRIMARY KEY =  (HabCod)
FOREING KEY =  (EHaCod)     -----> EstadoHabitacion
';


--
-- TOC entry 1770 (class 0 OID 0)
-- Dependencies: 1309
-- Name: COLUMN habitacion.habcod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN habitacion.habcod IS 'HabNum = Numero de Habitacion de acuerdo a cada Hotel

PRIMARY KEY = (HabCod)';


--
-- TOC entry 1771 (class 0 OID 0)
-- Dependencies: 1309
-- Name: COLUMN habitacion.habdesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN habitacion.habdesc IS 'HabDesc = Descripcion de la habitacion';


--
-- TOC entry 1772 (class 0 OID 0)
-- Dependencies: 1309
-- Name: COLUMN habitacion.ehacod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN habitacion.ehacod IS 'EHaCod = Codigo de Estado de habitacion

FOREIGN KEY = (EHaCod)   -------> EstadoHabitacion';


--
-- TOC entry 1308 (class 1259 OID 17023)
-- Dependencies: 4 1309
-- Name: habitacion_habcod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE habitacion_habcod_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.habitacion_habcod_seq OWNER TO postgres;

--
-- TOC entry 1773 (class 0 OID 0)
-- Dependencies: 1308
-- Name: habitacion_habcod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE habitacion_habcod_seq OWNED BY habitacion.habcod;


--
-- TOC entry 1774 (class 0 OID 0)
-- Dependencies: 1308
-- Name: habitacion_habcod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('habitacion_habcod_seq', 1, true);


--
-- TOC entry 1310 (class 1259 OID 17030)
-- Dependencies: 4
-- Name: habitacion_tipohab; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE habitacion_tipohab (
    habcod bigint NOT NULL,
    thacod bigint NOT NULL,
    habnum character varying(4),
    hthact boolean,
    habid integer NOT NULL
);


ALTER TABLE public.habitacion_tipohab OWNER TO postgres;

--
-- TOC entry 1775 (class 0 OID 0)
-- Dependencies: 1310
-- Name: TABLE habitacion_tipohab; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE habitacion_tipohab IS 'restringe el tipo de habitacion por cada habitacion, no puede tener otro tipo que no se haya definido anteriormente';


--
-- TOC entry 1776 (class 0 OID 0)
-- Dependencies: 1310
-- Name: COLUMN habitacion_tipohab.habnum; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN habitacion_tipohab.habnum IS 'HabNum = Numero de Habitacion de acuerdo a cada Hotel';


--
-- TOC entry 1335 (class 1259 OID 17157)
-- Dependencies: 1310 4
-- Name: habitacion_tipohab_habid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE habitacion_tipohab_habid_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.habitacion_tipohab_habid_seq OWNER TO postgres;

--
-- TOC entry 1777 (class 0 OID 0)
-- Dependencies: 1335
-- Name: habitacion_tipohab_habid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE habitacion_tipohab_habid_seq OWNED BY habitacion_tipohab.habid;


--
-- TOC entry 1778 (class 0 OID 0)
-- Dependencies: 1335
-- Name: habitacion_tipohab_habid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('habitacion_tipohab_habid_seq', 1, true);


--
-- TOC entry 1312 (class 1259 OID 17036)
-- Dependencies: 4
-- Name: mediotransporte; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE mediotransporte (
    mtrcod integer NOT NULL,
    mtrdesc character varying(20),
    mtrabr character varying(3)
);


ALTER TABLE public.mediotransporte OWNER TO postgres;

--
-- TOC entry 1779 (class 0 OID 0)
-- Dependencies: 1312
-- Name: TABLE mediotransporte; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE mediotransporte IS 'DESCRIPCION: Tabla de Medios de Transporte del Pasajero

PRIMARY KEY =  (MTrCod)
FOREING KEY =

';


--
-- TOC entry 1780 (class 0 OID 0)
-- Dependencies: 1312
-- Name: COLUMN mediotransporte.mtrcod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN mediotransporte.mtrcod IS 'MTrCod = Codigo de Medio de Transporte

PRIMARY KEY = (MTrCod)';


--
-- TOC entry 1781 (class 0 OID 0)
-- Dependencies: 1312
-- Name: COLUMN mediotransporte.mtrdesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN mediotransporte.mtrdesc IS 'MTrDesc = Descripcion del Medio de  Transporte

Valores: "TERRESTRE"
              "AEREO"
              "MARITIMO"';


--
-- TOC entry 1782 (class 0 OID 0)
-- Dependencies: 1312
-- Name: COLUMN mediotransporte.mtrabr; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN mediotransporte.mtrabr IS 'MTrAbr = Abreviacion de Medio de Transporte

Valores: "TERRESTRE" = "TER"
              "AEREO"          =  "AER"
              "MARITIMO"    =  "MAR"';


--
-- TOC entry 1311 (class 1259 OID 17034)
-- Dependencies: 4 1312
-- Name: mediotransporte_mtrcod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE mediotransporte_mtrcod_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.mediotransporte_mtrcod_seq OWNER TO postgres;

--
-- TOC entry 1783 (class 0 OID 0)
-- Dependencies: 1311
-- Name: mediotransporte_mtrcod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE mediotransporte_mtrcod_seq OWNED BY mediotransporte.mtrcod;


--
-- TOC entry 1784 (class 0 OID 0)
-- Dependencies: 1311
-- Name: mediotransporte_mtrcod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('mediotransporte_mtrcod_seq', 1, false);


--
-- TOC entry 1314 (class 1259 OID 17043)
-- Dependencies: 4
-- Name: moneda; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE moneda (
    moncod integer NOT NULL,
    mondesc character varying(20),
    monpred boolean,
    monsim character varying(3),
    monact boolean
);


ALTER TABLE public.moneda OWNER TO postgres;

--
-- TOC entry 1785 (class 0 OID 0)
-- Dependencies: 1314
-- Name: TABLE moneda; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE moneda IS 'DESCRIPCION: Tabla de Monedas

PRIMARY KEY =  (MonCod)
FOREING KEY =
';


--
-- TOC entry 1786 (class 0 OID 0)
-- Dependencies: 1314
-- Name: COLUMN moneda.moncod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN moneda.moncod IS 'MonCod = Codigo de Moneda

PRIMARY KEY = MonCod';


--
-- TOC entry 1787 (class 0 OID 0)
-- Dependencies: 1314
-- Name: COLUMN moneda.mondesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN moneda.mondesc IS 'MonDesc = Descripcion de Moneda

';


--
-- TOC entry 1788 (class 0 OID 0)
-- Dependencies: 1314
-- Name: COLUMN moneda.monpred; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN moneda.monpred IS 'MonPred = Moneda Predeterminada

Valores:  .True.   (1) = Predeterminada
              .False.   (0) = No Predeterminada';


--
-- TOC entry 1789 (class 0 OID 0)
-- Dependencies: 1314
-- Name: COLUMN moneda.monsim; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN moneda.monsim IS 'MonSim = Simbolo de Moneda

Ejemplo:  MonSim = "S/."
               MonSim = "US$."';


--
-- TOC entry 1790 (class 0 OID 0)
-- Dependencies: 1314
-- Name: COLUMN moneda.monact; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN moneda.monact IS 'MonAct = Moneda Activa

Valores:  .True.   (1) = Activa
              .False.   (1) = No Activa';


--
-- TOC entry 1313 (class 1259 OID 17041)
-- Dependencies: 4 1314
-- Name: moneda_moncod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE moneda_moncod_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.moneda_moncod_seq OWNER TO postgres;

--
-- TOC entry 1791 (class 0 OID 0)
-- Dependencies: 1313
-- Name: moneda_moncod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE moneda_moncod_seq OWNED BY moneda.moncod;


--
-- TOC entry 1792 (class 0 OID 0)
-- Dependencies: 1313
-- Name: moneda_moncod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('moneda_moncod_seq', 1, false);


--
-- TOC entry 1316 (class 1259 OID 17050)
-- Dependencies: 4
-- Name: motivoviaje; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE motivoviaje (
    mvjcod integer NOT NULL,
    mvjdesc character varying(20),
    mvjabr character varying(3)
);


ALTER TABLE public.motivoviaje OWNER TO postgres;

--
-- TOC entry 1793 (class 0 OID 0)
-- Dependencies: 1316
-- Name: TABLE motivoviaje; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE motivoviaje IS 'DESCRIPCION: Tabla de Motivo de Viaje de los Pasajeros

PRIMARY KEY =  (MVjCod)
FOREING KEY =


Tabla de los motivos de viaje disponibles';


--
-- TOC entry 1794 (class 0 OID 0)
-- Dependencies: 1316
-- Name: COLUMN motivoviaje.mvjcod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN motivoviaje.mvjcod IS 'MVjCod = Codigo de Motivo de Viaje

PRIMARY KEY = (MVjCod)';


--
-- TOC entry 1795 (class 0 OID 0)
-- Dependencies: 1316
-- Name: COLUMN motivoviaje.mvjdesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN motivoviaje.mvjdesc IS 'MVjDesc = Descripcion del Motivo de Viaje

Valores: "Turismo",  "Negocios", etc.';


--
-- TOC entry 1796 (class 0 OID 0)
-- Dependencies: 1316
-- Name: COLUMN motivoviaje.mvjabr; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN motivoviaje.mvjabr IS 'MVjAbr = Abreviacion del Motivo de Viaje

Valores: TURISMO = "TUR"
             NEGOCIOS = "NEG"';


--
-- TOC entry 1315 (class 1259 OID 17048)
-- Dependencies: 1316 4
-- Name: motivoviaje_mvjcod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE motivoviaje_mvjcod_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.motivoviaje_mvjcod_seq OWNER TO postgres;

--
-- TOC entry 1797 (class 0 OID 0)
-- Dependencies: 1315
-- Name: motivoviaje_mvjcod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE motivoviaje_mvjcod_seq OWNED BY motivoviaje.mvjcod;


--
-- TOC entry 1798 (class 0 OID 0)
-- Dependencies: 1315
-- Name: motivoviaje_mvjcod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('motivoviaje_mvjcod_seq', 1, false);


--
-- TOC entry 1318 (class 1259 OID 17057)
-- Dependencies: 4
-- Name: nivelusuario; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE nivelusuario (
    nuscod integer NOT NULL,
    nusdesc character varying(20),
    nusabre character varying(3)
);


ALTER TABLE public.nivelusuario OWNER TO postgres;

--
-- TOC entry 1799 (class 0 OID 0)
-- Dependencies: 1318
-- Name: TABLE nivelusuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE nivelusuario IS 'DESCRIPCION: Tabla de Nivel de Usuario. Se definen los diferentes Niveles de Usuario.
ALIAS: NUS

PRIMARY KEY =  (NUSCod)
FOREING KEY =
';


--
-- TOC entry 1800 (class 0 OID 0)
-- Dependencies: 1318
-- Name: COLUMN nivelusuario.nuscod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN nivelusuario.nuscod IS 'NumCod = Codigo de Nivel de Usuario

PRIMARY KEY = NusCod';


--
-- TOC entry 1801 (class 0 OID 0)
-- Dependencies: 1318
-- Name: COLUMN nivelusuario.nusdesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN nivelusuario.nusdesc IS 'NUSDesc = Descripción de Nivel de Usuario

';


--
-- TOC entry 1802 (class 0 OID 0)
-- Dependencies: 1318
-- Name: COLUMN nivelusuario.nusabre; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN nivelusuario.nusabre IS 'NUsAbre = Abreviación del Nivel de Usuario';


--
-- TOC entry 1317 (class 1259 OID 17055)
-- Dependencies: 4 1318
-- Name: nivelusuario_nuscod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE nivelusuario_nuscod_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.nivelusuario_nuscod_seq OWNER TO postgres;

--
-- TOC entry 1803 (class 0 OID 0)
-- Dependencies: 1317
-- Name: nivelusuario_nuscod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE nivelusuario_nuscod_seq OWNED BY nivelusuario.nuscod;


--
-- TOC entry 1804 (class 0 OID 0)
-- Dependencies: 1317
-- Name: nivelusuario_nuscod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('nivelusuario_nuscod_seq', 1, false);


--
-- TOC entry 1320 (class 1259 OID 17064)
-- Dependencies: 4
-- Name: paises; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE paises (
    paicod integer NOT NULL,
    paidesc character varying(30),
    paidescm character varying(30),
    paiabr character varying(3),
    painum character varying(3)
);


ALTER TABLE public.paises OWNER TO postgres;

--
-- TOC entry 1805 (class 0 OID 0)
-- Dependencies: 1320
-- Name: TABLE paises; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE paises IS 'DESCRIPCION: Tabla de Paises

PRIMARY KEY =  (PaiCod)
FOREING KEY =




tabla con la codificacion ISO de los países';


--
-- TOC entry 1806 (class 0 OID 0)
-- Dependencies: 1320
-- Name: COLUMN paises.paicod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN paises.paicod IS 'PaiCod = Codigo de Pais

PRIMARY KEY = (PaiCod)

Ejemplo:  PE = Peru
               AR = Argentina
               BR  = Brazil
Tambien es valido para la Codificacion de Internet.
Ejemplo: http://www.cesca.com.pe';


--
-- TOC entry 1807 (class 0 OID 0)
-- Dependencies: 1320
-- Name: COLUMN paises.paidesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN paises.paidesc IS 'PaiDesc = Descripcion del Pais (en Mayuscula)';


--
-- TOC entry 1808 (class 0 OID 0)
-- Dependencies: 1320
-- Name: COLUMN paises.paidescm; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN paises.paidescm IS 'PaiDescm = Descripcion del Pais (en Minuscula)';


--
-- TOC entry 1809 (class 0 OID 0)
-- Dependencies: 1320
-- Name: COLUMN paises.paiabr; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN paises.paiabr IS 'PaiAbr = Abreviacion del Pais (de acuerdo a Codificacion ISO)

Ejemplo:  PER = Peru
               ARG = Argentina
               BRA  = Brazil';


--
-- TOC entry 1810 (class 0 OID 0)
-- Dependencies: 1320
-- Name: COLUMN paises.painum; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN paises.painum IS 'PaiNum = Numero de Pais (de acuerdo a codificacion ISO)';


--
-- TOC entry 1319 (class 1259 OID 17062)
-- Dependencies: 1320 4
-- Name: paises_paicod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE paises_paicod_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.paises_paicod_seq OWNER TO postgres;

--
-- TOC entry 1811 (class 0 OID 0)
-- Dependencies: 1319
-- Name: paises_paicod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE paises_paicod_seq OWNED BY paises.paicod;


--
-- TOC entry 1812 (class 0 OID 0)
-- Dependencies: 1319
-- Name: paises_paicod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('paises_paicod_seq', 1, false);


--
-- TOC entry 1322 (class 1259 OID 17071)
-- Dependencies: 4
-- Name: tipocambio; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE tipocambio (
    tcbfec date NOT NULL,
    moncod bigint NOT NULL,
    tcbcom numeric(6,3),
    tcbven numeric(6,3),
    tcbid integer NOT NULL
);


ALTER TABLE public.tipocambio OWNER TO postgres;

--
-- TOC entry 1813 (class 0 OID 0)
-- Dependencies: 1322
-- Name: TABLE tipocambio; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipocambio IS 'DESCRIPCION: Tabla de Tipo de Cambio de cada Pais

PRIMARY KEY =  (TCBFec,  MonCod)
FOREING KEY =  ( MonCod)


';


--
-- TOC entry 1814 (class 0 OID 0)
-- Dependencies: 1322
-- Name: COLUMN tipocambio.tcbfec; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipocambio.tcbfec IS 'TCbFec = Fecha del Tipo de Cambio

PRIMARY KEY = (TCbFec)';


--
-- TOC entry 1815 (class 0 OID 0)
-- Dependencies: 1322
-- Name: COLUMN tipocambio.moncod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipocambio.moncod IS 'MonCod = Codigo de Moneda

FOREGIN KEY = (MonCod)';


--
-- TOC entry 1816 (class 0 OID 0)
-- Dependencies: 1322
-- Name: COLUMN tipocambio.tcbcom; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipocambio.tcbcom IS 'TCbCom = Importe del Tipo Cambio en Compra';


--
-- TOC entry 1817 (class 0 OID 0)
-- Dependencies: 1322
-- Name: COLUMN tipocambio.tcbven; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipocambio.tcbven IS 'TCbVen = Importe del Tipo Cambio en Venta';


--
-- TOC entry 1321 (class 1259 OID 17069)
-- Dependencies: 4 1322
-- Name: tipocambio_tcbid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipocambio_tcbid_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.tipocambio_tcbid_seq OWNER TO postgres;

--
-- TOC entry 1818 (class 0 OID 0)
-- Dependencies: 1321
-- Name: tipocambio_tcbid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipocambio_tcbid_seq OWNED BY tipocambio.tcbid;


--
-- TOC entry 1819 (class 0 OID 0)
-- Dependencies: 1321
-- Name: tipocambio_tcbid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('tipocambio_tcbid_seq', 1, false);


--
-- TOC entry 1324 (class 1259 OID 17078)
-- Dependencies: 4
-- Name: tipocontacto; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE tipocontacto (
    tcncod integer NOT NULL,
    tcndesc character varying(20),
    tcnabr character varying(3)
);


ALTER TABLE public.tipocontacto OWNER TO postgres;

--
-- TOC entry 1820 (class 0 OID 0)
-- Dependencies: 1324
-- Name: TABLE tipocontacto; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipocontacto IS 'DESCRIPCION: Tabla de Tipo de Contacto, mediante el cual el Pasajero, accedio al Hotel

PRIMARY KEY =  (TCnCod)
FOREING KEY =


';


--
-- TOC entry 1821 (class 0 OID 0)
-- Dependencies: 1324
-- Name: COLUMN tipocontacto.tcncod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipocontacto.tcncod IS 'TCnCod = Codigo de Tipo de Contacto';


--
-- TOC entry 1822 (class 0 OID 0)
-- Dependencies: 1324
-- Name: COLUMN tipocontacto.tcndesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipocontacto.tcndesc IS 'TCnDesc = Descripcion del Tipo de Contacto

Valores: "AGENCIA"
             "PARTICULAR"
             "OPERADOR"
';


--
-- TOC entry 1823 (class 0 OID 0)
-- Dependencies: 1324
-- Name: COLUMN tipocontacto.tcnabr; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipocontacto.tcnabr IS 'TCnAbr= Abreviacion del Tipo de Contcato

Valores: "AGENCIA"       = "AGN"
             "PARTICULAR" = "PAR"
             "OPERADOR"   = "OTR"
';


--
-- TOC entry 1323 (class 1259 OID 17076)
-- Dependencies: 4 1324
-- Name: tipocontacto_tcncod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipocontacto_tcncod_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.tipocontacto_tcncod_seq OWNER TO postgres;

--
-- TOC entry 1824 (class 0 OID 0)
-- Dependencies: 1323
-- Name: tipocontacto_tcncod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipocontacto_tcncod_seq OWNED BY tipocontacto.tcncod;


--
-- TOC entry 1825 (class 0 OID 0)
-- Dependencies: 1323
-- Name: tipocontacto_tcncod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('tipocontacto_tcncod_seq', 1, false);


--
-- TOC entry 1326 (class 1259 OID 17085)
-- Dependencies: 4
-- Name: tipodocumento; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE tipodocumento (
    tdccod integer NOT NULL,
    tdcdesc character varying(20),
    tdcabr character varying(3)
);


ALTER TABLE public.tipodocumento OWNER TO postgres;

--
-- TOC entry 1826 (class 0 OID 0)
-- Dependencies: 1326
-- Name: TABLE tipodocumento; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipodocumento IS 'DESCRIPCION: Tabla de Tipo de Documento del Pasajero.

PRIMARY KEY =  (TDcCod)
FOREING KEY =

puede ser DNI, pasaporte, ruc,etc';


--
-- TOC entry 1827 (class 0 OID 0)
-- Dependencies: 1326
-- Name: COLUMN tipodocumento.tdccod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumento.tdccod IS 'TDcCod = Tipo de Documento

PRIMARY KEY = (TDcCod)';


--
-- TOC entry 1828 (class 0 OID 0)
-- Dependencies: 1326
-- Name: COLUMN tipodocumento.tdcdesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumento.tdcdesc IS 'TDcDesc = Descripcion del Tipo de Documento

Valores: "D.N.I."
              "PASAPORTE"
              "CARNET DE EXTRANJERO"';


--
-- TOC entry 1829 (class 0 OID 0)
-- Dependencies: 1326
-- Name: COLUMN tipodocumento.tdcabr; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipodocumento.tdcabr IS 'TDcAbr = Abreviacion del Tipo de Documento

Valores: "D.N.I."               ="DNI"
              "PASAPORTE"  = "PAS"
              "CARNET DE EXTRANJERO" = "CIE"';


--
-- TOC entry 1325 (class 1259 OID 17083)
-- Dependencies: 1326 4
-- Name: tipodocumento_tdccod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipodocumento_tdccod_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.tipodocumento_tdccod_seq OWNER TO postgres;

--
-- TOC entry 1830 (class 0 OID 0)
-- Dependencies: 1325
-- Name: tipodocumento_tdccod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipodocumento_tdccod_seq OWNED BY tipodocumento.tdccod;


--
-- TOC entry 1831 (class 0 OID 0)
-- Dependencies: 1325
-- Name: tipodocumento_tdccod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('tipodocumento_tdccod_seq', 1, false);


--
-- TOC entry 1329 (class 1259 OID 17097)
-- Dependencies: 4
-- Name: tipohab_tipotarifa; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE tipohab_tipotarifa (
    thacod bigint NOT NULL,
    ttacod bigint NOT NULL,
    thtimp numeric(10,3),
    thtid integer NOT NULL
);


ALTER TABLE public.tipohab_tipotarifa OWNER TO postgres;

--
-- TOC entry 1832 (class 0 OID 0)
-- Dependencies: 1329
-- Name: TABLE tipohab_tipotarifa; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipohab_tipotarifa IS 'DESCRIPCION: Tabla de Tipo de Habitacion con Tipo Tarifa ( Modelo Boyce-Codd).
                          Relacion de los tipos de tarifas por cada tipo de habitacion

PRIMARY KEY =  (THaCod, TTaCod)
FOREING KEY =  (THaCod)   -----> THa
                             (TTaCod)   ------> TTa
                             (MonCod)   ------> Mon


';


--
-- TOC entry 1833 (class 0 OID 0)
-- Dependencies: 1329
-- Name: COLUMN tipohab_tipotarifa.thacod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohab_tipotarifa.thacod IS 'THaCod = Codigo de Tipo de Habitacion

PRIMARY KEY = (THaCod)
FOREIGN KEY = (THaCod)';


--
-- TOC entry 1834 (class 0 OID 0)
-- Dependencies: 1329
-- Name: COLUMN tipohab_tipotarifa.ttacod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohab_tipotarifa.ttacod IS 'TTaCod = Codigo de Tipo de Tarifa

PRIMARY KEY = (TTaCod)
FOREIGN KEY = (TTaCod)';


--
-- TOC entry 1835 (class 0 OID 0)
-- Dependencies: 1329
-- Name: COLUMN tipohab_tipotarifa.thtimp; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohab_tipotarifa.thtimp IS 'THTImp = Importe de la Tarifa (en la moneda determinada)';


--
-- TOC entry 1334 (class 1259 OID 17150)
-- Dependencies: 1329 4
-- Name: tipohab_tipotarifa_thtid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipohab_tipotarifa_thtid_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.tipohab_tipotarifa_thtid_seq OWNER TO postgres;

--
-- TOC entry 1836 (class 0 OID 0)
-- Dependencies: 1334
-- Name: tipohab_tipotarifa_thtid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipohab_tipotarifa_thtid_seq OWNED BY tipohab_tipotarifa.thtid;


--
-- TOC entry 1837 (class 0 OID 0)
-- Dependencies: 1334
-- Name: tipohab_tipotarifa_thtid_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('tipohab_tipotarifa_thtid_seq', 2, true);


--
-- TOC entry 1328 (class 1259 OID 17092)
-- Dependencies: 4
-- Name: tipohabitacion; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE tipohabitacion (
    thacod integer NOT NULL,
    thadesc character varying(20),
    thaabr character varying(3),
    thaccm smallint
);


ALTER TABLE public.tipohabitacion OWNER TO postgres;

--
-- TOC entry 1838 (class 0 OID 0)
-- Dependencies: 1328
-- Name: TABLE tipohabitacion; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipohabitacion IS 'DESCRIPCION: Tabla de Tipo de Habitacion.

PRIMARY KEY =  (THa)
FOREING KEY =

';


--
-- TOC entry 1839 (class 0 OID 0)
-- Dependencies: 1328
-- Name: COLUMN tipohabitacion.thacod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohabitacion.thacod IS 'THaCod = Codigo de Tipo de Habitacion

PRIMARY KEY = (THaCod)';


--
-- TOC entry 1840 (class 0 OID 0)
-- Dependencies: 1328
-- Name: COLUMN tipohabitacion.thadesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohabitacion.thadesc IS 'THaDesc = Descripcion del Tipo de Habitacion

Valores: "SIMPLE"
              "DOBLE"
              "MATRIMONIAL" ';


--
-- TOC entry 1841 (class 0 OID 0)
-- Dependencies: 1328
-- Name: COLUMN tipohabitacion.thaabr; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohabitacion.thaabr IS 'THaAbr = Abreviacion del Tipo de Habitacion

Valores: "SIMPLE"             = "SWB"
              "DOBLE"              = "DWB"
              "MATRIMONIAL"  = "MAT"';


--
-- TOC entry 1842 (class 0 OID 0)
-- Dependencies: 1328
-- Name: COLUMN tipohabitacion.thaccm; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipohabitacion.thaccm IS 'THaCCm = Cantidad de camas por Habitacion

Permite, limitar hasta cuantas podria tener una Habitacion

Restriccion: No puede ser: 0, negativo o mayor de 100 Camas.';


--
-- TOC entry 1327 (class 1259 OID 17090)
-- Dependencies: 1328 4
-- Name: tipohabitacion_thacod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipohabitacion_thacod_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.tipohabitacion_thacod_seq OWNER TO postgres;

--
-- TOC entry 1843 (class 0 OID 0)
-- Dependencies: 1327
-- Name: tipohabitacion_thacod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipohabitacion_thacod_seq OWNED BY tipohabitacion.thacod;


--
-- TOC entry 1844 (class 0 OID 0)
-- Dependencies: 1327
-- Name: tipohabitacion_thacod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('tipohabitacion_thacod_seq', 1, true);


--
-- TOC entry 1331 (class 1259 OID 17103)
-- Dependencies: 4
-- Name: tipotarifas; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE tipotarifas (
    ttacod integer NOT NULL,
    ttadesc character varying(20),
    ttaabr character varying(3),
    ttapred boolean
);


ALTER TABLE public.tipotarifas OWNER TO postgres;

--
-- TOC entry 1845 (class 0 OID 0)
-- Dependencies: 1331
-- Name: TABLE tipotarifas; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE tipotarifas IS 'DESCRIPCION: Tabla de Tipo de Tarifa por Habitacion.

PRIMARY KEY =  (TTaCod)
FOREING KEY =
';


--
-- TOC entry 1846 (class 0 OID 0)
-- Dependencies: 1331
-- Name: COLUMN tipotarifas.ttacod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipotarifas.ttacod IS 'TTaCod = Codugo de Tipo de Tarifa

PRIMARY KEY = (TTaCod)';


--
-- TOC entry 1847 (class 0 OID 0)
-- Dependencies: 1331
-- Name: COLUMN tipotarifas.ttadesc; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipotarifas.ttadesc IS 'TTaDesc = Descripcion del Tipo de Tarifa

Valores:  "PUBLICA"
               "CORPORATIVA"
               "PROMOCIONAL"';


--
-- TOC entry 1848 (class 0 OID 0)
-- Dependencies: 1331
-- Name: COLUMN tipotarifas.ttaabr; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipotarifas.ttaabr IS 'TTaAbr = Abreviacion del Tipo de Tarifa

Valores:  "PUBLICA"              =  "PUB"
               "CORPORATIVA"   =  "COR"
               "PROMOCIONAL"  =  "PRO"';


--
-- TOC entry 1849 (class 0 OID 0)
-- Dependencies: 1331
-- Name: COLUMN tipotarifas.ttapred; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN tipotarifas.ttapred IS 'TTaPred = Valor Predeterminado del Tipo de Tarifa

Valores:  .True. (1)  = Predeterminado
               .False. (0)  = No Predeterminado';


--
-- TOC entry 1330 (class 1259 OID 17101)
-- Dependencies: 1331 4
-- Name: tipotarifas_ttacod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tipotarifas_ttacod_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.tipotarifas_ttacod_seq OWNER TO postgres;

--
-- TOC entry 1850 (class 0 OID 0)
-- Dependencies: 1330
-- Name: tipotarifas_ttacod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tipotarifas_ttacod_seq OWNED BY tipotarifas.ttacod;


--
-- TOC entry 1851 (class 0 OID 0)
-- Dependencies: 1330
-- Name: tipotarifas_ttacod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('tipotarifas_ttacod_seq', 1, true);


--
-- TOC entry 1333 (class 1259 OID 17110)
-- Dependencies: 4
-- Name: usuario; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--

CREATE TABLE usuario (
    usulogin character varying(7) NOT NULL,
    usupass character varying(10),
    usunom character varying(40),
    nuscod integer NOT NULL
);


ALTER TABLE public.usuario OWNER TO postgres;

--
-- TOC entry 1852 (class 0 OID 0)
-- Dependencies: 1333
-- Name: TABLE usuario; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE usuario IS 'DESCRIPCION: Tabla de Usuario.
ALIAS: USU

PRIMARY KEY =  (USuLogin)
FOREING KEY =  (NUsCod)
';


--
-- TOC entry 1853 (class 0 OID 0)
-- Dependencies: 1333
-- Name: COLUMN usuario.usulogin; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.usulogin IS 'UsuLogin = Login del Usuario, con el cual se conecta al Sistema';


--
-- TOC entry 1854 (class 0 OID 0)
-- Dependencies: 1333
-- Name: COLUMN usuario.usupass; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.usupass IS 'USuPass = Ingresa la Palabra Clave (Password), del usurio';


--
-- TOC entry 1855 (class 0 OID 0)
-- Dependencies: 1333
-- Name: COLUMN usuario.usunom; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.usunom IS 'USUNom = Ingresa el Nombre y Apellido del Usuario, separado por un espacio      en blanco (gap), entre Nombre y Apellido';


--
-- TOC entry 1856 (class 0 OID 0)
-- Dependencies: 1333
-- Name: COLUMN usuario.nuscod; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.nuscod IS 'NUSCod = Indica el Nivel de Usuario.

FOREING KEY = NusCos  -----> NivelUsuario';


--
-- TOC entry 1332 (class 1259 OID 17108)
-- Dependencies: 4 1333
-- Name: usuario_nuscod_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE usuario_nuscod_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.usuario_nuscod_seq OWNER TO postgres;

--
-- TOC entry 1857 (class 0 OID 0)
-- Dependencies: 1332
-- Name: usuario_nuscod_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE usuario_nuscod_seq OWNED BY usuario.nuscod;


--
-- TOC entry 1858 (class 0 OID 0)
-- Dependencies: 1332
-- Name: usuario_nuscod_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('usuario_nuscod_seq', 1, false);


--
-- TOC entry 1666 (class 2604 OID 17006)
-- Dependencies: 1303 1302 1303
-- Name: ecvcod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE estadocivil ALTER COLUMN ecvcod SET DEFAULT nextval('estadocivil_ecvcod_seq'::regclass);


--
-- TOC entry 1667 (class 2604 OID 17013)
-- Dependencies: 1305 1304 1305
-- Name: ehacod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE estadohabitacion ALTER COLUMN ehacod SET DEFAULT nextval('estadohabitacion_ehacod_seq'::regclass);


--
-- TOC entry 1668 (class 2604 OID 17020)
-- Dependencies: 1306 1307 1307
-- Name: fpgcod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE formapago ALTER COLUMN fpgcod SET DEFAULT nextval('formapago_fpgcod_seq'::regclass);


--
-- TOC entry 1669 (class 2604 OID 17027)
-- Dependencies: 1308 1309 1309
-- Name: habcod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE habitacion ALTER COLUMN habcod SET DEFAULT nextval('habitacion_habcod_seq'::regclass);


--
-- TOC entry 1670 (class 2604 OID 17159)
-- Dependencies: 1335 1310
-- Name: habid; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE habitacion_tipohab ALTER COLUMN habid SET DEFAULT nextval('habitacion_tipohab_habid_seq'::regclass);


--
-- TOC entry 1671 (class 2604 OID 17038)
-- Dependencies: 1311 1312 1312
-- Name: mtrcod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE mediotransporte ALTER COLUMN mtrcod SET DEFAULT nextval('mediotransporte_mtrcod_seq'::regclass);


--
-- TOC entry 1672 (class 2604 OID 17045)
-- Dependencies: 1313 1314 1314
-- Name: moncod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE moneda ALTER COLUMN moncod SET DEFAULT nextval('moneda_moncod_seq'::regclass);


--
-- TOC entry 1673 (class 2604 OID 17052)
-- Dependencies: 1316 1315 1316
-- Name: mvjcod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE motivoviaje ALTER COLUMN mvjcod SET DEFAULT nextval('motivoviaje_mvjcod_seq'::regclass);


--
-- TOC entry 1674 (class 2604 OID 17059)
-- Dependencies: 1317 1318 1318
-- Name: nuscod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE nivelusuario ALTER COLUMN nuscod SET DEFAULT nextval('nivelusuario_nuscod_seq'::regclass);


--
-- TOC entry 1675 (class 2604 OID 17066)
-- Dependencies: 1319 1320 1320
-- Name: paicod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE paises ALTER COLUMN paicod SET DEFAULT nextval('paises_paicod_seq'::regclass);


--
-- TOC entry 1676 (class 2604 OID 17073)
-- Dependencies: 1321 1322 1322
-- Name: tcbid; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE tipocambio ALTER COLUMN tcbid SET DEFAULT nextval('tipocambio_tcbid_seq'::regclass);


--
-- TOC entry 1677 (class 2604 OID 17080)
-- Dependencies: 1324 1323 1324
-- Name: tcncod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE tipocontacto ALTER COLUMN tcncod SET DEFAULT nextval('tipocontacto_tcncod_seq'::regclass);


--
-- TOC entry 1678 (class 2604 OID 17087)
-- Dependencies: 1325 1326 1326
-- Name: tdccod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE tipodocumento ALTER COLUMN tdccod SET DEFAULT nextval('tipodocumento_tdccod_seq'::regclass);


--
-- TOC entry 1680 (class 2604 OID 17152)
-- Dependencies: 1334 1329
-- Name: thtid; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE tipohab_tipotarifa ALTER COLUMN thtid SET DEFAULT nextval('tipohab_tipotarifa_thtid_seq'::regclass);


--
-- TOC entry 1679 (class 2604 OID 17094)
-- Dependencies: 1327 1328 1328
-- Name: thacod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE tipohabitacion ALTER COLUMN thacod SET DEFAULT nextval('tipohabitacion_thacod_seq'::regclass);


--
-- TOC entry 1681 (class 2604 OID 17105)
-- Dependencies: 1331 1330 1331
-- Name: ttacod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE tipotarifas ALTER COLUMN ttacod SET DEFAULT nextval('tipotarifas_ttacod_seq'::regclass);


--
-- TOC entry 1682 (class 2604 OID 17112)
-- Dependencies: 1333 1332 1333
-- Name: nuscod; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE usuario ALTER COLUMN nuscod SET DEFAULT nextval('usuario_nuscod_seq'::regclass);


--
-- TOC entry 1726 (class 0 OID 16998)
-- Dependencies: 1301
-- Data for Name: contactos_huesped; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY contactos_huesped (cntcod, cntdesc) FROM stdin;
\.


--
-- TOC entry 1727 (class 0 OID 17004)
-- Dependencies: 1303
-- Data for Name: estadocivil; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY estadocivil (ecvcod, ecvdesc, ecvabr) FROM stdin;
1	DFH	\N
2	DFGDFG	SDG
\.


--
-- TOC entry 1728 (class 0 OID 17011)
-- Dependencies: 1305
-- Data for Name: estadohabitacion; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY estadohabitacion (ehacod, ehadesc, ehaabr, ehacol, ehaact) FROM stdin;
1	Bueno	bnu	Azul	t
2	casa	cas	red	t
\.


--
-- TOC entry 1729 (class 0 OID 17018)
-- Dependencies: 1307
-- Data for Name: formapago; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY formapago (fpgcod, fpgdesc, fpgabr) FROM stdin;
\.


--
-- TOC entry 1730 (class 0 OID 17025)
-- Dependencies: 1309
-- Data for Name: habitacion; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY habitacion (habcod, habdesc, ehacod) FROM stdin;
1	sexo	1
\.


--
-- TOC entry 1731 (class 0 OID 17030)
-- Dependencies: 1310
-- Data for Name: habitacion_tipohab; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY habitacion_tipohab (habcod, thacod, habnum, hthact, habid) FROM stdin;
\.


--
-- TOC entry 1732 (class 0 OID 17036)
-- Dependencies: 1312
-- Data for Name: mediotransporte; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY mediotransporte (mtrcod, mtrdesc, mtrabr) FROM stdin;
\.


--
-- TOC entry 1733 (class 0 OID 17043)
-- Dependencies: 1314
-- Data for Name: moneda; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY moneda (moncod, mondesc, monpred, monsim, monact) FROM stdin;
\.


--
-- TOC entry 1734 (class 0 OID 17050)
-- Dependencies: 1316
-- Data for Name: motivoviaje; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY motivoviaje (mvjcod, mvjdesc, mvjabr) FROM stdin;
\.


--
-- TOC entry 1735 (class 0 OID 17057)
-- Dependencies: 1318
-- Data for Name: nivelusuario; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY nivelusuario (nuscod, nusdesc, nusabre) FROM stdin;
\.


--
-- TOC entry 1736 (class 0 OID 17064)
-- Dependencies: 1320
-- Data for Name: paises; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY paises (paicod, paidesc, paidescm, paiabr, painum) FROM stdin;
\.


--
-- TOC entry 1737 (class 0 OID 17071)
-- Dependencies: 1322
-- Data for Name: tipocambio; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY tipocambio (tcbfec, moncod, tcbcom, tcbven, tcbid) FROM stdin;
\.


--
-- TOC entry 1738 (class 0 OID 17078)
-- Dependencies: 1324
-- Data for Name: tipocontacto; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY tipocontacto (tcncod, tcndesc, tcnabr) FROM stdin;
\.


--
-- TOC entry 1739 (class 0 OID 17085)
-- Dependencies: 1326
-- Data for Name: tipodocumento; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY tipodocumento (tdccod, tdcdesc, tdcabr) FROM stdin;
\.


--
-- TOC entry 1741 (class 0 OID 17097)
-- Dependencies: 1329
-- Data for Name: tipohab_tipotarifa; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY tipohab_tipotarifa (thacod, ttacod, thtimp, thtid) FROM stdin;
1	1	2221.000	1
\.


--
-- TOC entry 1740 (class 0 OID 17092)
-- Dependencies: 1328
-- Data for Name: tipohabitacion; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY tipohabitacion (thacod, thadesc, thaabr, thaccm) FROM stdin;
1	wwwwwwwwww	sdf	12
\.


--
-- TOC entry 1742 (class 0 OID 17103)
-- Dependencies: 1331
-- Data for Name: tipotarifas; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY tipotarifas (ttacod, ttadesc, ttaabr, ttapred) FROM stdin;
1	sdfguyuyiuh	sdg	t
\.


--
-- TOC entry 1743 (class 0 OID 17110)
-- Dependencies: 1333
-- Data for Name: usuario; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY usuario (usulogin, usupass, usunom, nuscod) FROM stdin;
\.


--
-- TOC entry 1684 (class 2606 OID 17001)
-- Dependencies: 1301 1301
-- Name: pk_contactos_huesped; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY contactos_huesped
    ADD CONSTRAINT pk_contactos_huesped PRIMARY KEY (cntcod);


--
-- TOC entry 1686 (class 2606 OID 17008)
-- Dependencies: 1303 1303
-- Name: pk_estadocivil; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY estadocivil
    ADD CONSTRAINT pk_estadocivil PRIMARY KEY (ecvcod);


--
-- TOC entry 1688 (class 2606 OID 17015)
-- Dependencies: 1305 1305
-- Name: pk_estadohabitacion; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY estadohabitacion
    ADD CONSTRAINT pk_estadohabitacion PRIMARY KEY (ehacod);


--
-- TOC entry 1690 (class 2606 OID 17022)
-- Dependencies: 1307 1307
-- Name: pk_formapago; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY formapago
    ADD CONSTRAINT pk_formapago PRIMARY KEY (fpgcod);


--
-- TOC entry 1692 (class 2606 OID 17029)
-- Dependencies: 1309 1309
-- Name: pk_habitacion; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY habitacion
    ADD CONSTRAINT pk_habitacion PRIMARY KEY (habcod);


--
-- TOC entry 1694 (class 2606 OID 17033)
-- Dependencies: 1310 1310 1310
-- Name: pk_habitacion_tipohab; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY habitacion_tipohab
    ADD CONSTRAINT pk_habitacion_tipohab PRIMARY KEY (habcod, thacod);


--
-- TOC entry 1696 (class 2606 OID 17040)
-- Dependencies: 1312 1312
-- Name: pk_mediotransporte; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY mediotransporte
    ADD CONSTRAINT pk_mediotransporte PRIMARY KEY (mtrcod);


--
-- TOC entry 1698 (class 2606 OID 17047)
-- Dependencies: 1314 1314
-- Name: pk_moneda; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY moneda
    ADD CONSTRAINT pk_moneda PRIMARY KEY (moncod);


--
-- TOC entry 1700 (class 2606 OID 17054)
-- Dependencies: 1316 1316
-- Name: pk_motivoviaje; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY motivoviaje
    ADD CONSTRAINT pk_motivoviaje PRIMARY KEY (mvjcod);


--
-- TOC entry 1702 (class 2606 OID 17061)
-- Dependencies: 1318 1318
-- Name: pk_nivelusuario; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY nivelusuario
    ADD CONSTRAINT pk_nivelusuario PRIMARY KEY (nuscod);


--
-- TOC entry 1704 (class 2606 OID 17068)
-- Dependencies: 1320 1320
-- Name: pk_paises; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY paises
    ADD CONSTRAINT pk_paises PRIMARY KEY (paicod);


--
-- TOC entry 1706 (class 2606 OID 17075)
-- Dependencies: 1322 1322 1322
-- Name: pk_tipocambio; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY tipocambio
    ADD CONSTRAINT pk_tipocambio PRIMARY KEY (tcbfec, moncod);


--
-- TOC entry 1708 (class 2606 OID 17082)
-- Dependencies: 1324 1324
-- Name: pk_tipocontacto; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY tipocontacto
    ADD CONSTRAINT pk_tipocontacto PRIMARY KEY (tcncod);


--
-- TOC entry 1710 (class 2606 OID 17089)
-- Dependencies: 1326 1326
-- Name: pk_tipodocumento; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY tipodocumento
    ADD CONSTRAINT pk_tipodocumento PRIMARY KEY (tdccod);


--
-- TOC entry 1714 (class 2606 OID 17100)
-- Dependencies: 1329 1329 1329
-- Name: pk_tipohab_tipotarifa; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY tipohab_tipotarifa
    ADD CONSTRAINT pk_tipohab_tipotarifa PRIMARY KEY (thacod, ttacod);


--
-- TOC entry 1712 (class 2606 OID 17096)
-- Dependencies: 1328 1328
-- Name: pk_tipohabitacion; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY tipohabitacion
    ADD CONSTRAINT pk_tipohabitacion PRIMARY KEY (thacod);


--
-- TOC entry 1716 (class 2606 OID 17107)
-- Dependencies: 1331 1331
-- Name: pk_tipotarifas; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY tipotarifas
    ADD CONSTRAINT pk_tipotarifas PRIMARY KEY (ttacod);


--
-- TOC entry 1718 (class 2606 OID 17114)
-- Dependencies: 1333 1333
-- Name: pk_usuario; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY usuario
    ADD CONSTRAINT pk_usuario PRIMARY KEY (usulogin);


--
-- TOC entry 1719 (class 2606 OID 17115)
-- Dependencies: 1305 1309 1687
-- Name: fk_habitaci_reference_estadoha; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY habitacion
    ADD CONSTRAINT fk_habitaci_reference_estadoha FOREIGN KEY (ehacod) REFERENCES estadohabitacion(ehacod) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1720 (class 2606 OID 17120)
-- Dependencies: 1309 1691 1310
-- Name: fk_habitaci_reference_habitaci; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY habitacion_tipohab
    ADD CONSTRAINT fk_habitaci_reference_habitaci FOREIGN KEY (habnum) REFERENCES habitacion(habcod) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1721 (class 2606 OID 17125)
-- Dependencies: 1328 1711 1310
-- Name: fk_habitaci_reference_tipohabi; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY habitacion_tipohab
    ADD CONSTRAINT fk_habitaci_reference_tipohabi FOREIGN KEY (thacod) REFERENCES tipohabitacion(thacod) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1722 (class 2606 OID 17130)
-- Dependencies: 1322 1314 1697
-- Name: fk_tipocamb_reference_moneda; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipocambio
    ADD CONSTRAINT fk_tipocamb_reference_moneda FOREIGN KEY (moncod) REFERENCES moneda(moncod) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1724 (class 2606 OID 17140)
-- Dependencies: 1328 1711 1329
-- Name: fk_tipohab__reference_tipohabi; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipohab_tipotarifa
    ADD CONSTRAINT fk_tipohab__reference_tipohabi FOREIGN KEY (thacod) REFERENCES tipohabitacion(thacod) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1723 (class 2606 OID 17135)
-- Dependencies: 1715 1329 1331
-- Name: fk_tipohab__reference_tipotari; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tipohab_tipotarifa
    ADD CONSTRAINT fk_tipohab__reference_tipotari FOREIGN KEY (ttacod) REFERENCES tipotarifas(ttacod) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1725 (class 2606 OID 17145)
-- Dependencies: 1333 1318 1701
-- Name: fk_usuario_reference_nivelusu; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY usuario
    ADD CONSTRAINT fk_usuario_reference_nivelusu FOREIGN KEY (nuscod) REFERENCES nivelusuario(nuscod) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1748 (class 0 OID 0)
-- Dependencies: 4
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


-- Completed on 2009-11-13 14:12:28

--
-- PostgreSQL database dump complete
--

